import { _decorator, Component, Node, quat, Quat, v3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('RotationForever')
export class RotationForever extends Component {
    @property
    speed: number = 100;
    start() {}

    eulerV3 = v3();
    quatRet = quat();

    update(deltaTime: number) {
        this.node.rotation.getEulerAngles(this.eulerV3);
        let angle = this.eulerV3.y;
        angle += deltaTime * this.speed;
        Quat.fromEuler(this.quatRet, 0, angle, 0);
        this.node.rotation = this.quatRet;
    }
}
